useFixture(default)

def test():
	from Modules import commonBits
	java_recorded_version = '1.6.0_17'

	if window('Protocol Buffer Editor'):
		select('FileChooser', commonBits.sampleDir() +  'Ams_LocDownload_20041228.bin')
		click('Edit1')
		select('Table', 'cell:2|Loc_Nbr,0(5839)')
		rightclick('Table', '2|Loc_Nbr,9')
##		select('Table', 'cell:2|Loc_Nbr,0(5839)')
		select_menu('Edit Record')
##		select('Table1', 'cell:2|Loc_Nbr,0(5839)')
		assert_p('Table', 'Content', '[[Brand_Id, 1, , TAR, TAR], [Loc_Nbr, 2, , 5052, 5052], [Loc_Type, 3, , ST, ST], [Loc_Name, 4, , Eastwood, Eastwood], [Loc_Addr_Ln1, 5, , Marayong Offsite Reserve, Marayong Offsite Reserve], [Loc_Addr_Ln2, 6, , 11 Melissa Place, 11 Melissa Place], [Loc_Addr_Ln3, 7, , Marayong, Marayong], [Loc_Postcode, 8, , 2148, 2148], [Loc_State, 9, , NSW, NSW], [Loc_Actv_Ind, 10, , A, A]]')
		select_menu('Edit>>Show / Hide Fields')
		assert_p('Table', 'Content', '[[Brand_Id, true], [Loc_Nbr, true], [Loc_Type, true], [Loc_Name, true], [Loc_Addr_Ln1, true], [Loc_Addr_Ln2, true], [Loc_Addr_Ln3, true], [Loc_Postcode, true], [Loc_State, true], [Loc_Actv_Ind, true]]')
		select('Table', 'cell:Show,0(true)')
		select('Table', 'cell:Show,2(true)')
		select('Table', 'cell:Show,5(true)')
		select('Table', 'cell:Show,7(true)')
		select('Table', 'cell:Show,8(true)')
		select('Table', 'cell:Show,9(true)')
		assert_p('Table', 'Content', '[[Brand_Id, false], [Loc_Nbr, true], [Loc_Type, false], [Loc_Name, true], [Loc_Addr_Ln1, true], [Loc_Addr_Ln2, false], [Loc_Addr_Ln3, true], [Loc_Postcode, false], [Loc_State, false], [Loc_Actv_Ind, false]]')
		click('Go')
		assert_p('Table', 'Content', '[[Loc_Nbr, 2, , 5052, 5052], [Loc_Name, 4, , Eastwood, Eastwood], [Loc_Addr_Ln1, 5, , Marayong Offsite Reserve, Marayong Offsite Reserve], [Loc_Addr_Ln3, 7, , Marayong, Marayong]]')
##		select('Table', '')
		rightclick('Table', 'Data,2')
		select_menu('Show Locations Fields>>Loc_Actv_Ind')
		assert_p('Table', 'Content', '[[Loc_Nbr, 2, , 5052, 5052], [Loc_Name, 4, , Eastwood, Eastwood], [Loc_Addr_Ln1, 5, , Marayong Offsite Reserve, Marayong Offsite Reserve], [Loc_Addr_Ln3, 7, , Marayong, Marayong], [Loc_Actv_Ind, 10, , A, A]]')
##		select('Table', '')
		rightclick('Table', 'Data,3')
		select_menu('Show Locations Fields>>Loc_State')
		assert_p('Table', 'Content', '[[Loc_Nbr, 2, , 5052, 5052], [Loc_Name, 4, , Eastwood, Eastwood], [Loc_Addr_Ln1, 5, , Marayong Offsite Reserve, Marayong Offsite Reserve], [Loc_Addr_Ln3, 7, , Marayong, Marayong], [Loc_State, 9, , NSW, NSW], [Loc_Actv_Ind, 10, , A, A]]')
##		select('Table', '')
		rightclick('Table', 'Data,2')
		select_menu('Hide Column')
		assert_p('Table', 'Content', '[[Loc_Nbr, 2, , 5052, 5052], [Loc_Name, 4, , Eastwood, Eastwood], [Loc_Addr_Ln3, 7, , Marayong, Marayong], [Loc_State, 9, , NSW, NSW], [Loc_Actv_Ind, 10, , A, A]]')
		select_menu('Edit>>Show / Hide Fields')
##		assert_p('Table', 'Content', '[[Brand_Id, true], [Loc_Nbr, true], [Loc_Type, false], [Loc_Name, true], [Loc_Addr_Ln1, false], [Loc_Addr_Ln2, false], [Loc_Addr_Ln3, true], [Loc_Postcode, false], [Loc_State, true], [Loc_Actv_Ind, true]]')
		assert_p('Table', 'Content', '[[Brand_Id, false], [Loc_Nbr, true], [Loc_Type, false], [Loc_Name, true], [Loc_Addr_Ln1, false], [Loc_Addr_Ln2, false], [Loc_Addr_Ln3, true], [Loc_Postcode, false], [Loc_State, true], [Loc_Actv_Ind, true]]')
		select('Table', 'cell:Show,7(false)')
		select('Table', 'cell:Show,4(false)')
		assert_p('Table', 'Content', '[[Brand_Id, false], [Loc_Nbr, true], [Loc_Type, false], [Loc_Name, true], [Loc_Addr_Ln1, true], [Loc_Addr_Ln2, false], [Loc_Addr_Ln3, true], [Loc_Postcode, true], [Loc_State, true], [Loc_Actv_Ind, true]]')
		select('Table', 'cell:Show,0(true)')

		click('Go')
		assert_p('Table', 'Content', '[[Brand_Id, 1, , TAR, TAR], [Loc_Nbr, 2, , 5052, 5052], [Loc_Name, 4, , Eastwood, Eastwood], [Loc_Addr_Ln1, 5, , Marayong Offsite Reserve, Marayong Offsite Reserve], [Loc_Addr_Ln3, 7, , Marayong, Marayong], [Loc_Postcode, 8, , 2148, 2148], [Loc_State, 9, , NSW, NSW], [Loc_Actv_Ind, 10, , A, A]]')

##		select('Table', '')
		rightclick('Table', 'Data,5')
		select_menu('Show Locations Fields>>Loc_Addr_Ln2')
##		click('MetalInternalFrameTitlePane', 277, 18)
##		select('Table', '')
		rightclick('Table', 'Data,6')
		select_menu('Hide Column')
		select_menu('Edit>>Show / Hide Fields')
		assert_p('Table', 'Content', '[[Brand_Id, true], [Loc_Nbr, true], [Loc_Type, false], [Loc_Name, true], [Loc_Addr_Ln1, true], [Loc_Addr_Ln2, true], [Loc_Addr_Ln3, true], [Loc_Postcode, false], [Loc_State, true], [Loc_Actv_Ind, true]]')
		select('Table', 'cell:Show,7(false)')
		select('Table', 'cell:Show,2(false)')
		click('Go')
		assert_p('Table', 'Content', '[[Brand_Id, 1, , TAR, TAR], [Loc_Nbr, 2, , 5052, 5052], [Loc_Type, 3, , ST, ST], [Loc_Name, 4, , Eastwood, Eastwood], [Loc_Addr_Ln1, 5, , Marayong Offsite Reserve, Marayong Offsite Reserve], [Loc_Addr_Ln2, 6, , 11 Melissa Place, 11 Melissa Place], [Loc_Addr_Ln3, 7, , Marayong, Marayong], [Loc_Postcode, 8, , 2148, 2148], [Loc_State, 9, , NSW, NSW], [Loc_Actv_Ind, 10, , A, A]]')
	close()
